<html>
<head>
	<title></title>
</head>
<body>
<?php 
	function add($a,$b){
		return $a+$b;
	}	

	echo add(3,2);

	function foo(){
		function bar(){

		}
	}
	foo();
	bar();// must call foo() first ,then can call bar();

	function swap($a, $b){
		$tmp = $a;
		$a = $b;
		$b = $tmp;
	}

	$a = "a";
	$b =  "b";
	swap($a, $b);
	echo "<br> after swap,\$a= $a";
?>
<h4> lib function</h4>
<?php 
	$arr=array(1,2,3);
	print_r(array_count_values($arr)); echo "<br>";
	echo abs(-3);echo "<br>";
	echo floor(5.1);echo "<br>";
	echo ceil(5.2);echo "<br>";
	echo pi();echo "<br>";
	echo min(3.2, 4);echo "<br>";
	echo max(1.1, 2.2);echo "<br>";
?>
<br/>
<a href="/control_flow.php">control flow in php</a>
</body>
</html>
